package com.mynewspaper.components;

import com.mynewspaper.app.Session;
import com.webobjects.appserver.WOContext;
import com.mynewspaper.entity.User;

import er.extensions.components.ERXComponent;

public class Main extends ERXComponent {
	private static final long serialVersionUID = 6198167961693752950L;
	
	public Boolean showNews = false;
	public Boolean showRegistration = false;
	public Boolean showContacts =  false;
	//public Boolean showUserInfoComponent = false;
	public Boolean loginError = false;
	
	static {
		User userAnna = new User("Anna", "Anna", "an", "an");
		Session session = (Session) Session.session();
		session.addUser(userAnna);
	}
	
	public Main(WOContext context) {
		super(context);
	}
	
	public Boolean isLogin() {
		return ((Session)session()).getUser() != null;
	}
}
